package a02demo2;

import java.io.File;

public class Test2 {
    public static void main(String[] args) {
        File f = new File("D:\\vscode\\JavaScript");
        File[] files = f.listFiles();
        boolean b = check(files);
        System.out.println(b);
    }

    public static boolean check(File[] files) {
        for (File file : files) {
            if (file.isFile() && file.getName().endsWith(".js")) {
                return true;
            }
        }
        return false;
    }
}
